home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / db / esm-3.1 / esm-3 / usr / local / sm / src / client / include / serverinfo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-05  |  3.7 KB  |  119 lines

  1. #ifndef _SERVERINFO_H_
  2. #define _SERVERINFO_H_
  3. /*
  4.  *   $RCSfile: serverinfo.h,v $  
  5.  *   $Revision: 1.1.1.1 $  
  6.  *   $Date: 1996/05/04 21:55:20 $      
  7.  */ 
  8. /**********************************************************************
  9. * EXODUS Database Toolkit Software
  10. * Copyright (c) 1991 Computer Sciences Department, University of
  11. *                    Wisconsin -- Madison
  12. * All Rights Reserved.
  13. *
  14. * Permission to use, copy, modify and distribute this software and its
  15. * documentation is hereby granted, provided that both the copyright
  16. * notice and this permission notice appear in all copies of the
  17. * software, derivative works or modified versions, and any portions
  18. * thereof, and that both notices appear in supporting documentation.
  19. *
  20. * THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY OF WISCONSIN --
  21. * MADISON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.  
  22. * THE DEPARTMENT DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
  23. * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  24. *
  25. * The EXODUS Project Group requests users of this software to return 
  26. * any improvements or extensions that they make to:
  27. *
  28. *   EXODUS Project Group 
  29. *     c/o David J. DeWitt and Michael J. Carey
  30. *   Computer Sciences Department
  31. *   University of Wisconsin -- Madison
  32. *   Madison, WI 53706
  33. *
  34. *     or exodus@cs.wisc.edu
  35. *
  36. * In addition, the EXODUS Project Group requests that users grant the 
  37. * Computer Sciences Department rights to redistribute these changes.
  38. **********************************************************************/
  39.  
  40. /*
  41.  * This file contains structures used to maintain information
  42.  * about servers that the client is connected to, or can connect to.
  43.  */
  44. #include "forward.h"
  45. #include "bf.h"
  46. #include "sysdefs.h"
  47. #include "loginfo.h"
  48. #include "trans.h"
  49.  
  50. /* BEGIN visible to user */
  51. #define MAX_HOSTNAME    100
  52. #define MAX_SERVERNAME  100
  53. /* END visible to user */
  54.  
  55.  
  56. class SERVERINFO {
  57. public:
  58.     FLAGS        flags;            /* SERV_xxx below */
  59.     int         socket;
  60.     char        hostName[MAX_HOSTNAME];
  61.     HOSTENT     *hostEnt;
  62.     SOCKADDR    connectAddr;
  63.     char        name[MAX_SERVERNAME];
  64.     LOGINFO        logInfo;
  65.     LIST        transList;  /* transactions using this server */
  66.     LISTELEMENT    list;    /* for use by pool & hash table */
  67.  
  68.     /* These are really just for bookkeeping & sanity checking  */
  69.     short int    nMounted;        /* # volumes we have mounted on this server */
  70.  
  71.     void Init();
  72.     void ReInit();
  73.     BOOL    Dump(FILE *f);
  74.     SOCKADDRCLASS *keylocation(int unique, SOCKADDRCLASS **unused);
  75.     LISTELEMENT *listlocation(int unique);
  76. };
  77.  
  78. #define SERV_NOTCONNECTED    0x0    
  79. #define SERV_CONNECTED    0x1     /* has a tcp connx */
  80. #define SERV_ESTAB        0x2     /* INIT_CLIENT done */
  81. #define SERV_LOGGING_INITD 0x4     /* a clog_serverInit was done 
  82.                     (not done for administrative clients) */
  83. #define SERV_IN_TX         0x8     /* has a transaction active */
  84. #define SERV_MOUNTED_VOL 0x10     /* mounted the given volume
  85.                                         (for use with a VOLREC *) */
  86. #define SERV_CONTACTED_IN_PAST    0x80     /* not in use */
  87.  
  88. #define NOSOCKET    -1
  89.  
  90. extern int ServerInfoPoolSize;
  91. extern int ServerInfoTableSize;
  92.  
  93. /* stuff for distributed transactions: */
  94. /*************************************************************************
  95.  * NB: must #define away the SERVERINFO * for users.
  96.  *************************************************************************/
  97. #ifndef __USER__
  98. #define void SERVERINFO
  99. #endif
  100. /* BEGIN visible to user */
  101. /*
  102.  *  define the coordinator handle
  103.  */
  104. typedef struct {
  105.      TID         coordTid;
  106.     char        hostName[MAX_HOSTNAME];  /* a.b.c.d of the server's host 
  107.                             from inet_ntoa(host's inaddr) */
  108.     char        serverName[MAX_SERVERNAME];    
  109.                         /* string representation of port # */
  110.  
  111. } COORD_HANDLE;
  112. /* END visible to user */
  113. #ifndef __USER__
  114. #undef void 
  115. #endif
  116.  
  117.  
  118. #endif _SERVERINFO_H_
  119.